// ディレクトリ表示

#include <stdio.h>
#include <dirent.h>


int main( int argc, char* argv[] )
{
	int ret;
	DIR *dp;
	struct dirent *dirp;

	dp = opendir( argv[1] );

	if( dp == NULL ){
		printf( "can't open!!\n" );
		closedir(dp);
		return 1;
	}

	dirp = readdir( dp );

	while( dirp != NULL ){
		printf( "%s\n", dirp->d_name );
		dirp = readdir( dp );
	}

	closedir(dp);

	return 0;
}